home *** CD-ROM | disk | FTP | other *** search
- Path: oxy.rust.net!usenet
- From: Neil <neil@aol2.com>
- Newsgroups: comp.lang.c++
- Subject: Major problem with strings.
- Date: Sun, 10 Mar 1996 20:31:33 -0500
- Organization: Almighty Online
- Message-ID: <31438275.72DB@aol2.com>
- NNTP-Posting-Host: liv-27.rust.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Here's my code:
-
- 1 char *club="";
- 2 club="/public_html/neil";
-
- 3 strcat(club,argv[1]+5);
-
- 4 strcat(club,"/");
-
- ----------------------------------------
- (lines are numbered for reference only)
-
- the argv[1] looks like: "test=12345"
-
- So, ultimately, I want club to look like: "/public_html/neil12345"
-
- I need to add that last "/" (slash) character, and whenever
- I do that, KA-BLAMO, it starts adding all of these WEIRD characters.
-
- Step 1 just sets up club as a pointer to a char.
- Step 2 sets up the initial content to be "/public_html/neil"
- Step 3 concats the "12345" part of argv[1] to club
- Step 4 SHOULD concat "/" to club..
-
- But when Step 4 occurs, it seems to wrap around numbers, and it
- gets all messy. Any reason you can see?
-
- Please mailto: neil@aol2.com
-
- I've been battling this for HOURS!
-
- Thanks,
- Neil
-